<template>
	<view class="content">		
		<view class="flppdp">
			<view :class="[(active1 == index)?'active1':'']" class="fs18 C999" @click="tab(index);" v-for="(item,index) in flppdpLis" :key="index">{{item.name}}</view>
		</view>	
		<view class="content1">			
			<view v-for="(item,index) in allData" :key="index" class="commonBox">
				<view class="flexsb">
					<view style="width: 167px;" class="">
						<image style="width: 167upx;height: 167upx;" :src="item.inform_goods_image" mode=""></image>
					</view>
					<view style="width: 500px;">
						<view style="min-height: 70upx;" class="twoline fs20 C333 lh40">
							{{item.inform_goods_name}}
						</view>
						<view class="fs18 C999 lh80">
							商家：<text class="Cf71c6e">{{item.inform_store_name}}</text>
						</view>
					</view>
				</view>			
				<view class="fs18 C999 lh50">
					举报类型：{{item.inform_subject_type_name}}
				</view>
				<view class="fs18 C999 lh50">
					举报主题：{{item.inform_subject_content}}
				</view>
				<view class="fs18 C999 lh50">
					举报时间：{{item.inform_datetime | formaDate('yyyy-mm-dd-hh-mm-ss')}}
				</view>
				<view class="fs18 C999 lh50">
					处理状态：
					<text v-if="item.inform_state == 1">未处理</text>					
					<text v-if="item.inform_state == 2">已处理</text>					
				</view>
				<view style="margin-top: 34upx;" class="flexsb">
					<view style="width: 50%;" class=""></view>
					<view>
						<text @click="cancel(item.inform_id)" class="grayBtn1">取消</text>
						<text @click="toLook(item.inform_id)" class="redBtn1">查看</text>			
					</view>
				</view>
			</view>				
		</view>
		
		<view v-if="allData.length<=0" class="None">
			<image style="width: 100%;" :src="`${picUrl}/InfoNull.png`" mode="widthFix"></image>
		</view>
	s
	</view>
	
	
</template>

<script>
	export default {
		data(){
			return{
				select_inform_state:0,
				flag:true,
				curpage:1,
				hasmore:false,
				allData:[],
				notsettleData:[],
				settleData:[],
				active1:0,
				flppdpLis:[
					{"name":"全部","toUrl":""},
					{"name":"未处理","toUrl":""},
					{"name":"已处理","toUrl":""}
				],
				sortPage:0,
				active2flag:0,
				bottomBtn:[
					{"name":"首页","img1":"../../static/images/home_bottom11.png","img2":"../../static/images/home_bottom12.png","toUrl":"../home/index"},
					{"name":"分类","img1":"../../static/images/home_bottom21.png","img2":"../../static/images/home_bottom22.png","toUrl":"../sort/sortPage"},
					{"name":"分销","img1":"../../static/images/home_bottom31.png","img2":"../../static/images/home_bottom32.png","toUrl":"../distribution/list"},
					{"name":"购物车","img1":"../../static/images/home_bottom41.png","img2":"../../static/images/home_bottom42.png","toUrl":"../car/shopCar"},
					{"name":"会员中心","img1":"../../static/images/home_bottom51.png","img2":"../../static/images/home_bottom52.png","toUrl":"/pages/home/Personal_Center"}
				]
			}
		},
		onLoad() {
			this.gettousuLis()
		},
		onShow() {
			
		},
		onReachBottom() {
			if(this.hasmore){
				this.$util.request({
					url: '/mobile/index.php?act=member_complain&op=index',
					method: 'post',
					data: {
						"select_inform_state":this.select_inform_state,
						"curpage":this.curpage
					},
				}).then((res)=> {	
					this.curpage++
					this.allData=this.allData.concat(res.datas.list) 
					this.hasmore=res.datas.paged.hasmore
					this.curpage=res.datas.paged.curpage					
				})
			}else{
				uni.showToast({
					title:"没有更多数据",
					icon:"none"
				})
			}
		},
		methods:{
			gettousuLis(){
				let that = this;			
				this.$util.request({
					url: '/mobile/index.php?act=member_inform&op=inform_list',
					method: 'get',
					data: {
						"select_inform_state":this.select_inform_state,
						"curpage":this.curpage
					},
				}).then((res)=> {	
					// if(res.datas.list.length == 0){
					// 	this.flag=true
					// 	uni.showToast({
					// 		title:"没有数据",
					// 		icon:"none"
					// 	})
					// }
					this.allData=res.datas.list
					this.hasmore=res.datas.paged.hasmore
					this.curpage=res.datas.paged.curpage					
				})
				
			},
			toLook(id){
				uni.navigateTo({
					url:"info?inform_id="+id
				})
			},
			cancel(id){
				let that = this;
				uni.showModal({
					title:'提示',
					content:"是否确定取消此记录？",
					confirmColor:"#ff4300",
					success: function(res) {
					if (res.confirm) {						
						that.$util.request({
							url: '/mobile/index.php?act=member_inform&op=inform_cancel',
							method: 'get',
							data: {
								"inform_id":id
							},
						}).then(function(res) {
							if(res.error_code==0){
								uni.showToast({
									title:"取消成功",
									icon:"none"
								})
								that.gettousuLis();
							}else{
								uni.showToast({
									title:res.message,
									icon:"none"
								})
							}
						})
					} else if (res.cancel) {
						console.log('用户点击取消');
					}
					}
				})	
			},
			tab(index){
				this.active1=index	
				this.select_inform_state=index
				this.gettousuLis()
			},
			tab2(index,url){
				this.active2flag=index
				console.log(this.active2flag);
				uni.switchTab({
					url:url
				})
			}
		}
	}
</script>

<style>
	.None{
		    height: 92%;
		    background-color: #fff;
	}
	.titleNview-placing {
		height: var(--status-bar-height);
		box-sizing: content-box;
	 }
	view{
		box-sizing: content-box;		
	}
	uni-page-body {
		background-color: #FFFFFF;
		color: rgb(102, 102, 102);
	}
	.titleNview-placing {
		height: var(--status-bar-height);
		box-sizing: content-box;
	 }
	.lh20{
		line-height: 20upx;
		height: 20upx;
	}
	.lh25{
		line-height: 25upx;
	}
	.lh30{
		line-height: 30upx;
	}
	.lh35{
		line-height: 35upx;
	}
	.lh40{
		line-height: 40upx;
	}
	.lh45{
		line-height: 45upx;
	}
	.lh50{
		line-height: 50upx;
	}
	.lh60{
		line-height: 60upx;
	}
	.lh70{
		line-height: 70upx;
	}
	.lh80{
		line-height: 80upx;
	}
	.C000{
		color: #000000;
	}
	.Ce13d97{
		color: #ff4300;
	}
	.Cfe0000{
		color: #ff4300;
	}
	.Cc06{
		color: #ff4300;
	}
	.mt55mb30{
		margin-top: 55upx;
		margin-bottom: 30upx;
	}
	.Cfff{
		color: #FFFFFF;
	}
	
	.flex{		
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-content: space-between;
	}
	.paddingL20{
		padding-left: 20upx;
	}
	.C999{
		color:#999 ;
	}
	.Cff0101{
		color:#ff0101 ;
	}
	.Cc00251{
		color: #c00251;
	}
	.strick{
		text-decoration: line-through;
	}
	.Cfe0000{
		color: #ff4300;
	}
	.line1{
		width: 430upx;
	}
	.hide{
		display: none;
	}
	.marginB20{
		margin-bottom: 20upx;
	}
	.oneLine{
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
	.twoline{
	   overflow : hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
	}
	.pl20{
		padding-left: 20upx;
	}
	.positionT{
		position: relative;
		top: 50upx;
	}
	.paddingB15{
		padding-bottom: 15upx;
	}
	.borderB{
		border-bottom: 1px solid #f4f4f6;
	}
	.borderT{
		border-top: 1px solid #f4f4f6;
	}
	.gl{
		position: absolute;
		right: 30upx;
	}
	.pr30{
		padding-right: 30upx;
	}
	.C333{
		color: #333333;
	}
	.C666{
		color: #666666;
	}
	.Cf00{
		color: #ff0000;
	}
	
	.bold{
		font-weight: bold;
	}
	.C1d1d1d{
		color:#1d1d1d ;
	}
	.fl{
		float: left;
	}
	.fr{
		float: right;
	}
	.tac{
		text-align: center;
	}
	.Ce5258e{
		color: #e5258e;
	}
	.Cccc{
		color: #CCCCCC;
	}
	.Cf7881c{
		color: #f7881c;
	}
	uni-page-body {
		background-color: #FFFFFF;
		color: rgb(102, 102, 102);
	}		
	.fs30{
		/* font-size: 30upx */
		font-size: 45upx
	}
	.fs26{
		font-size:39upx
		/* font-size: 26upx */
	}
	.fs12{
		font-size: 18upx
		/* font-size: 12upx */
	}
	.fs16{
		font-size: 24upx
		/* font-size: 16upx */
	}
	.fs14{
		font-size: 21upx
		/* font-size: 14upx */
	}
	.fs15{
		font-size: 22.5upx
		/* font-size: 15upx */
	}
	.fs27{
		font-size: 40.5upx
		/* font-size: 27upx */
	}
	.fs18{
		font-size: 27upx
		/* font-size: 18upx */
	}
	.fs28{
		font-size: 42upx
		/* font-size: 28upx */
	}
	.fs10{
		font-size: 15upx
		/* font-size: 10upx */
	}
	.fs30{
		font-size: 45upx
		/* font-size: 28upx */
	}
	.fs36{
		font-size: 54upx
		/* font-size: 28upx */
	}
	
	.fs24{
		font-size: 36upx
		/* font-size: 24upx */
	}
	.fs20{
		font-size:30upx
		/* font-size: 20upx */
	}
	.fs22{
		font-size:33upx
		/* font-size: 22upx */
	}
	.fs21{
		font-size: 31.5upx
		/* font-size: 21upx */
	}	
	.flexsb{
		display: flex;
		justify-content: space-between;
	}
	.plr20{
		padding: 0 20upx;
	}
	.plr10{
		padding: 0 10upx;
	}
	.f6f4f5{
		background-color: #fff;
	}	
	.Cf74d0f{
		color: #f74d0f;
	}
	.Cf71c6e{
		color: #ff4300;
	}
	.C2dc34d{
		color: #2dc34d;
	}
	.mt20{
		margin-top: 20upx;
	}
	.ti2{
		text-indent: 2em;
	}
	
	
	.content{
		height: 100%;
		background-color: #f6f4f5;
	}
	
	.bottom{
		box-sizing: border-box;
		padding: 0 10upx;
		background-color: #FFFFFF;
		position: fixed;
		z-index: 99999999999;
		left: 0;
		bottom: 0;
		height: 100upx;
		width: 100%;
		/* box-shadow: 0upx -1upx 10upx rgba(0,0,0,0.8); */
		display: flex;
		/* flex-direction: row; */
		/* justify-content: space-around; */
	}
	.bottom>view{
		width: 150upx;
		height: 100upx;
	}
	.bottom view{
		font-size: 24upx;
		color: #666;
		text-align: center;
	}
	.bottom view.active2{
		color: #ff4300;
	}
	.bottom image{
		position: relative;
		top: 15upx;
		width: 48upx;
		height: 48upx;
	}
	.flppdp{
		display: flex;
		justify-content: space-around;
	}
	.flppdp view{
		width: 33%;	
		text-align: center;
		height: 123upx;
		line-height: 123upx;
	}
	.flppdp view.active1{
		border-bottom: 1upx solid #ff4300;
		color:#ff4300;
	}
	.commonBox{
		box-sizing: border-box;
		padding: 20upx;
		width: 100%;
/* 		height: 458upx; */
		background-color: #fff;
		margin-bottom: 20upx;
	}
	.grayBtn1{
		display: inline-block;
		width: 150upx;
		line-height: 50upx;
		height: 50upx;
		text-align: center;
		background-color: #f1f1f1;
		color: #666666;
	}
	.redBtn1{
		display: inline-block;
		width: 150upx;
		line-height: 50upx;
		height: 50upx;
		text-align: center;
		background-color: #ff4300;
		color: #FFFFFF;
		margin-left: 34upx;
	}

</style>

